<section class="action-nav-bar">
  <admin-ng-nav></admin-ng-nav>
  <nav>
    <a href="#!/statistics/organization"
       ng-class="{active: resource == 'organization'}"
       translate="STATISTICS.NAVIGATION.ORGANIZATION"
       with-role="ROLE_UI_STATISTICS_ORGANIZATION_VIEW">
      <!-- Statistics Organization View -->
    </a>
  </nav>
</section>

<div class="main-view" ng-switch="resource">
  <div class="obj statistics" ng-switch-when="organization">

    <div class="controls-container">
      <h1 translate="STATISTICS.NAVIGATION.ORGANIZATION"></h1>
    </div>
    <div class="statistics">
      <div class="modal-alert danger" ng-if="statReusable.error" translate="STATISTICS.NOT_AVAILABLE"></div>

      <div class="obj" ng-repeat="data in statReusable.statProviderData" ng-if="!statReusable.error">
        <header class="no-expand" translate="{{ data.title }}">
          <!-- Statistics -->
        </header>
        <div class="obj-container" ng-if="data.providerType == 'timeSeries'">
          <statistics-graph
            chart-labels="data.labels"
            chart-options="data.options"
            data-resolution="data.dataResolution"
            provider="data.providerId"
            from="data.from"
            on-change="statReusable.recalculate(data.providerId, from, to, dataResolution, timeChooseMode)"
            export-url="data.csvUrl"
            export-file-name="statisticsCsvFileName(data.title | translate)"
            source-data="data.values"
            time-choose-mode="data.timeChooseMode"
            to="data.to"
            total-value="data.totalValue"
            description="data.description"
          >
          </statistics-graph>
        </div>
        <div class="modal-alert danger" ng-if="data.providerType != 'timeSeries'" translate="STATISTICS.UNSUPPORTED_TYPE"></div>
      </div>
    </div>
  </div>
</div>
